class soundMgr {
	public constructor() {
	}
	private _sound: egret.Sound;
    private _channel: egret.SoundChannel;
	/**
	 * 播放声音
	 * path 声音路径
	 * loopCount 循环次数 <无限循环
	 */
	public playerSound(path:string,loopCount:number)
	{
        var sound: egret.Sound = this._sound = new egret.Sound();;
        //sound 加载完成监听
        sound.addEventListener(egret.Event.COMPLETE, function (e: egret.Event) {
			//sound 播放会返回一个 SoundChannel 对象，暂停、音量等操作请控制此对象
            this._channel = this._sound.play(0, loopCount);
        }, this);

        sound.load(path);
	}
	/**关闭声音 */
	public closeSound()
	{
		if(this._channel!=null)
		{
			this._channel.stop();
			this._channel=null;
		}
	}
}